//
// Created by jiang on 2022/1/4.
//

#ifndef FOC_FILTER_H
#define FOC_FILTER_H

#include "param.h"

void MID_Init(mid_t *pHandle, uint8_t num);

int MID_Filter(mid_t *pHandle, int x0);

void MEAN_Init(mean_t *pHandle, uint8_t num);

int MEAN_Filter(mean_t *pHandle, int x0);

void IIR_Init(iir_t *pHandle, const int16_t *num, const int16_t *den);

int IIR_Filter(iir_t *pHandle, int x0);

void IIRF_Init(iirf_t *pHandle, const float *num, const float *den);

int IIRF_Filter(iirf_t *pHandle, float x0);

void Kalman_Init(kalman_t *pHandle, int Q, int R);

int Kalman_Filter(kalman_t *pHandle, int x0, int y1);

void LPF_Init(lpf_t *pHandle, uint16_t g);

int LPF_Filter(lpf_t *pHandle, int x0, int y1);

#endif //FOC_FILTER_H
